package com.herenit.beijing.dh2011.entity;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "ET_MODELS")
public class EtModels implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	@TableGenerator(
			name = "idGenerator", 
			table = "ET_Id_Generator", 
			pkColumnName = "pkColumn",
			valueColumnName = "valueColumn",
			pkColumnValue = "model_id",
			allocationSize = 100,
			initialValue = 1
			)
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "idGenerator")
	private long id;
	@Column(name = "MODEL_NAME")
	private String modelName;
	@Column(name = "MODEL_CODE")
	private String modelCode;
	@Column(name = "CREATED_BY")
	private long createdBy;
	@Column(name = "CREATION_DATE")
	private Timestamp creationDate;
	@Column(name = "CREATED_BY_NAME")
	private String createdByName;
	@Column(name = "LAST_UPDATED_BY")
	private long lastUpdatedBy;
	@Column(name = "LAST_UPDATE_DATE")
	private Timestamp lastUpdateDate;
	@Column(name = "LAST_UPDATED_BY_NAME")
	private long lastUpdatedByName;

	@OneToMany(mappedBy = "etModels", fetch = FetchType.LAZY)
	private List<EtCodingSchemes> etCodingSchemes ;

	public EtModels() {
		Long i = new Long(1);
		Timestamp nowTime = new Timestamp(new Date().getTime());
		createdBy = i;
		creationDate = nowTime;
		lastUpdatedBy = i;
		lastUpdateDate = nowTime;
		
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getModelName() {
		return modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	public String getModelCode() {
		return modelCode;
	}

	public void setModelCode(String modelCode) {
		this.modelCode = modelCode;
	}

	public long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(long createdBy) {
		this.createdBy = createdBy;
	}

	public Timestamp getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Timestamp creationDate) {
		this.creationDate = creationDate;
	}

	public String getCreatedByName() {
		return createdByName;
	}

	public void setCreatedByName(String createdByName) {
		this.createdByName = createdByName;
	}

	public long getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(long lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public Timestamp getLastUpdateDate() {
		return lastUpdateDate;
	}

	public void setLastUpdateDate(Timestamp lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}

	public long getLastUpdatedByName() {
		return lastUpdatedByName;
	}

	public void setLastUpdatedByName(long lastUpdatedByName) {
		this.lastUpdatedByName = lastUpdatedByName;
	}

	public List<EtCodingSchemes> getEtCodingSchemes() {
		return etCodingSchemes;
	}

	public void setEtCodingSchemes(List<EtCodingSchemes> etCodingSchemes) {
		this.etCodingSchemes = etCodingSchemes;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	

}